PROJECT_NAME := app
PROJECT_PATH := $(abspath .)
PROJECT_BOARD := evb
export PROJECT_PATH PROJECT_BOARD
#CONFIG_TOOLPREFIX :=

-include ./proj_config.mk

ifeq ($(origin BL60X_SDK_PATH), undefined)
BL60X_SDK_PATH_GUESS ?= $(shell pwd)
BL60X_SDK_PATH ?= $(BL60X_SDK_PATH_GUESS)/../../sdk/bl_iot_sdk
$(info ****** Please SET BL60X_SDK_PATH ******)
$(info ****** Trying SDK PATH [$(BL60X_SDK_PATH)])
endif

EXTRA_COMPONENT_DIRS += $(BL60X_SDK_PATH)/../../modules
EXTRA_COMPONENT_DIRS += $(BL60X_SDK_PATH)/../../lib/riscv/bouffalolab
COMPONENT_INCLUDES += $(BL60X_SDK_PATH)/../../modules/iotjs/bouffalolab

CFLAGS += -DFREERTOS
CFLAGS += -DEVM_LANG_ENABLE_REPL
CFLAGS += -DEVM_LANG_ENABLE_JAVASCRIPT
CFLAGS += -DCONFIG_EVM_ECMA_OBJECT
CFLAGS += -DCONFIG_EVM_ECMA_ARRAY
CFLAGS += -DCONFIG_EVM_ECMA_NUMBER
CFLAGS += -DCONFIG_EVM_ECMA_STRING
CFLAGS += -DCONFIG_EVM_ECMA_MATH
CFLAGS += -DCONFIG_EVM_ECMA_TIMEOUT
CFLAGS += -DCONFIG_EVM_ECMA_CONSOLE

CFLAGS += -DCONFIG_EVM_MODULE_ASSERT
CFLAGS += -DCONFIG_EVM_MODULE_PROCESS
CFLAGS += -DCONFIG_EVM_MODULE_NET
CFLAGS += -DCONFIG_EVM_MODULE_DNS
CFLAGS += -DCONFIG_EVM_MODULE_BUFFER
CFLAGS += -DCONFIG_EVM_MODULE_TIMERS
CFLAGS += -DCONFIG_EVM_MODULE_GPIO
CFLAGS += -DCONFIG_EVM_MODULE_UART
CFLAGS += -DCONFIG_EVM_MODULE_FS
CFLAGS += -DCONFIG_EVM_MODULE_HTTP

COMPONENTS_NETWORK := sntp dns_server
COMPONENTS_BLSYS   := bltime blfdt blmtd bloop loopadc looprt loopset
COMPONENTS_VFS     := romfs

INCLUDE_COMPONENTS += freertos_riscv_ram bl602 bl602_std bl602_wifi bl602_wifidrv hal_drv lwip lwip_dhcpd lwip_mdns vfs yloop utils netutils cli blog blog_testc
INCLUDE_COMPONENTS += easyflash4
INCLUDE_COMPONENTS += ejs
INCLUDE_COMPONENTS += ecma
INCLUDE_COMPONENTS += iotjs
INCLUDE_COMPONENTS += $(COMPONENTS_NETWORK)
INCLUDE_COMPONENTS += $(COMPONENTS_BLSYS)
INCLUDE_COMPONENTS += $(COMPONENTS_VFS)
INCLUDE_COMPONENTS += $(PROJECT_NAME)

include $(BL60X_SDK_PATH)/make_scripts_riscv/project.mk
